home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgramD2.iso
/
Borland
/
Borland C++ V5.02
/
CLASSSRC.PAK
/
HEAPSEL.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-06
|
961b
|
35 lines
//----------------------------------------------------------------------------
// Borland Class Library
// Copyright (c) 1993, 1997 by Borland International, All Rights Reserved
//
//$Revision: 5.6 $
//
//----------------------------------------------------------------------------
#include <classlib/pch.h>
#include <services/defs.h>
//
// THeapSelector doesn't have to do anything special unless its under Win16.
// Then we have to worry about multiple heaps.
//
#if defined(BI_PLAT_WIN16)
#include <classlib/heapsel.h>
#include <services/wsysinc.h>
void _BIDSFARDATA *THeapSelector::Allocate( size_t sz ) const
{
HeapSetup frame(FP_SEG(this));
return MK_FP( _DS, ::LocalAlloc( sz, LMEM_MOVEABLE ) );
}
void THeapSelector::Free( void _BIDSFARDATA *block )
{
HeapSetup frame(FP_SEG(block));
HANDLE hMem = ::LocalHandle( (void NEAR*)FP_OFF(block) );
if( hMem )
::LocalFree( hMem );
}
#endif